create table own_user
(
    id         bigserial
        primary key,
    name       varchar(50) not null,
    last_name  varchar(50) not null,
    patronymic varchar(50),
    login      varchar(25) not null
        unique,
    password   varchar(72) not null,
    is_active  boolean     not null,
    birth_date timestamp   not null,
    avatar_uri varchar,
    role       varchar(20) not null
);

create table tech_stack
(
    id        bigserial primary key,
    name      varchar(100) not null,
    is_active boolean      not null
);

create table mentor
(
    id         bigint primary key references own_user (id),
    profession varchar(20) not null,
    experience smallint       not null
);

create table mentor_tech_stack
(
    mentor_id     bigint references mentor (id),
    tech_stack_id bigint references tech_stack (id)
);

create table student
(
    id         bigint primary key references own_user (id),
    profession varchar(20) not null
);